﻿using System;
using Com.PhilChuang.Mobile.Apps.LocationSender.Model.Data;
using Com.PhilChuang.Pmvp.Ui.Views.Impl.ViewModels;
using Com.PhilChuang.Utils;
using Microsoft.Phone.Controls.Maps;

namespace Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.ViewModels
{
	public abstract class AbstractLocationSenderAppViewModel : AbstractViewModel
	{
		public string AppVersionString
		{ get { return AppServiceLocator.Instance.GetImpl<VersionInfo> ().ToStringOr ("N/A"); } }

		public ApplicationIdCredentialsProvider BingMapsCredentials { get; private set; }

		#region Bindable Properties
		private String myAppStatus;
		public String AppStatus
		{
			get { return myAppStatus; }
			set
			{
				myAppStatus = value;
				RaisePropertyChanged (() => AppStatus);
			}
		}

		private GeoCoordinate myCurrentPosition;
		public GeoCoordinate CurrentPosition
		{
			get { return myCurrentPosition; }
			set
			{
				myCurrentPosition = value;
				RaisePropertyChanged (() => CurrentPosition);
			}
		}
		#endregion

		#region Constructors
		protected AbstractLocationSenderAppViewModel ()
		{
			BingMapsCredentials = AppServiceLocator.Instance.GetImpl<IBingMapsCredentialProvider> ().Credentials;
			PropertyChanged += OnPropertyChanged;
		}

		protected virtual void OnPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
		}
		#endregion

		#region Functionality (EMPTY)
		#endregion

		#region Utility methods (EMPTY)
		#endregion
	}
}
